package com.ning.cloud.user.api.client;

import com.ning.cloud.common.constant.ServiceNameConstant;
import com.ning.cloud.common.util.Response;
import com.ning.cloud.user.api.dto.UserDTO;
import com.ning.cloud.user.api.dto.UserRegisterDTO;
import com.ning.cloud.user.api.request.UserRegisterRequest;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(name = ServiceNameConstant.USER_SERVICE)
@Tag(name = "用户服务-接口调用")
public interface UserClient {

    @GetMapping("/openapi/user/{id}")
    Response<UserDTO> getUserById(@PathVariable("id") Long id);

    @PostMapping("/openapi/user/register")
    @Operation(summary = "用户注册")
    Response<UserRegisterDTO> register(@RequestBody @Valid UserRegisterRequest userRegisterRequest);

}
